package protocol.meta;

import org.json.JSONException;
import org.json.JSONObject;

import com.netease.log.NTLog;


public class APPSetting {

	private boolean receiveAllMessage;
	private boolean receiveAllComment;
	private boolean banPush;
	private boolean atMe;
	private boolean newComment;
	private boolean newLetter;
	private boolean newFans;
	private boolean friendDynamic;
	private boolean shock;
	private boolean sound;
	private long timestamp;

	public boolean isReceiveAllMessage() {
		return receiveAllMessage;
	}

	public void setReceiveAllMessage(boolean receiveAllMessage) {
		this.receiveAllMessage = receiveAllMessage;
	}

	public boolean isReceiveAllComment() {
		return receiveAllComment;
	}

	public void setReceiveAllComment(boolean receiveAllComment) {
		this.receiveAllComment = receiveAllComment;
	}

	public boolean isBanPush() {
		return banPush;
	}

	public void setBanPush(boolean banPush) {
		this.banPush = banPush;
	}

	public boolean isAtMe() {
		return atMe;
	}

	public void setAtMe(boolean atMe) {
		this.atMe = atMe;
	}

	public boolean isNewComment() {
		return newComment;
	}

	public void setNewComment(boolean newComment) {
		this.newComment = newComment;
	}

	public boolean isNewLetter() {
		return newLetter;
	}

	public void setNewLetter(boolean newLetter) {
		this.newLetter = newLetter;
	}

	public boolean isNewFans() {
		return newFans;
	}

	public void setNewFans(boolean newFans) {
		this.newFans = newFans;
	}

	public boolean isFriendDynamic() {
		return friendDynamic;
	}

	public void setFriendDynamic(boolean friendDynamic) {
		this.friendDynamic = friendDynamic;
	}

	public boolean isShock() {
		return shock;
	}

	public void setShock(boolean shock) {
		this.shock = shock;
	}

	public boolean isSound() {
		return sound;
	}

	public void setSound(boolean sound) {
		this.sound = sound;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Long timestamp) {
		this.timestamp = timestamp;
	}

    public JSONObject getJSONObject() {
        JSONObject json = new JSONObject();
        try {
            json.put("receiveAllMessage", receiveAllMessage);
            json.put("receiveAllComment", receiveAllComment);
            json.put("banPush", banPush);
            NTLog.e("APPSetting", "pushoff is" + banPush);
            json.put("atMe", atMe);
            json.put("newComment", newComment);
            json.put("newLetter", newLetter);
            json.put("newFans", newFans);
            json.put("friendDynamic", friendDynamic);
            json.put("shock", shock);
            json.put("sound", sound);
//            json.put("timestamp", timestamp);
//            NTLog.e("APPSetting", "timestamp" + timestamp);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return json;
    }

    @Override
    public String toString() {
        return getJSONObject().toString();
    }
}
